home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / elecmail / fido1000.zip / SRC1000.ZIP / GT16.H < prev    next >
C/C++ Source or Header  |  1993-05-21  |  8KB  |  181 lines

  1. /*  As some of the information contained herein is derived from information
  2.     gained through the distibution of source code by P&M Software, the
  3.     following notice is required:
  4.  
  5. ******************************************************************************
  6.  
  7.           Copyright (C)  P&M Software Co 1990.  All rights reserved
  8.  
  9.                   THIS PROGRAM BELONGS TO P&M SOFTWARE CO.
  10.  
  11.           The copyright owner hereby grants to you the right to
  12.       use this program as long as you abide by the following
  13.       restrictions:
  14.  
  15.           1.  Any product developed on information obtained herein
  16.           must be distributed free of charge.  In the same manner
  17.           this program was distributed.
  18.  
  19.           2.  Any product developed on information obtained herein
  20.           must be distributed in source code form.  In the same
  21.           manner this program was distributed.
  22.  
  23.           3.  This notice must not be removed.  And it must be included
  24.           in any product developed on information obtained herein.
  25.  
  26.  
  27. ******************************************************************************
  28. */
  29.  
  30.  
  31. /* using 16.00 control structures for GT area */
  32.  
  33. #define TMPMSGCTL    "MESSAGE.TMP"    /* temp file to write work data for out */
  34. #define MSGCTL       "MESSAGE.CTL"    /* message headers                      */
  35. #define USRMSG       "USER_MSG.CTL"   /* user pointers in area                */
  36. #define USERFILE     "USER.CTL"       /* user security file                   */
  37. #define FILEPATH     "GTMSGS\\"       /* subdirectory for message texts       */
  38. #define MAXMSGSZ     0xF000           /* size of mbuffer                      */
  39. #define MAXGTLLEN    300              /* maximum length of a line in GT msg   */
  40. #define MSGCTLSZ     128              /* size of message.ctl entry            */
  41. #define MAX_USR_MSG  256              /* maximum number of users in one area  */
  42.  
  43. #define SUNDAYOFFS (EDAYOFFS + 1515 - (7 * 500))  /* julian date of a sunday */
  44.  
  45. #define PRIV_MASK    0x0001
  46.                                              /*  OFFSETS */
  47. typedef struct   _usrrec      {              /*==========*/
  48.     char         user_deleted;               /*      0   */
  49.     char         user_name[31];              /*      1   */
  50.     char         user_first_date[9];         /*     32   */
  51.     char         user_first_time[6];         /*     41   */
  52.     char         user_last_date[9];          /*     47   */
  53.     char         user_last_time[6];          /*     56   */
  54.     int          user_credit;                /*     62   */
  55.     int          user_charges;               /*     64   */
  56.     int          user_times_on;              /*     66   */
  57.     char         user_banned;                /*     68   */
  58.     char         user_expert;                /*     69   */
  59.     char         user_more;                  /*     70   */
  60.     char         user_home[31];              /*     71   */
  61.     char         user_phone[11];             /*    102   */
  62.     char         user_password[21];          /*    113   */
  63.     char         user_privel;                /*    134   */
  64.     int          user_calls;                 /*    135   */
  65.     int          user_accum_time;            /*    137   */
  66.     char         user_protocol;              /*    139   */
  67.     int          user_screen_lgth;           /*    140   */
  68.     int          user_upload_k;              /*    142   */
  69.     int          user_upload_files;          /*    144   */
  70.     int          user_dnload_k;              /*    146   */
  71.     int          user_dnload_files;          /*    148   */
  72.     long         user_caller_no;             /*    150   */
  73.     int          user_hash_code;             /*    154   */
  74.     char         user_cb_handle[10];         /*    156   */
  75.     char         user_filler[10];            /*    166   */
  76. } USER_RECORD;
  77.  
  78. typedef struct _usrmsgrec {
  79.     char       user_msg_deleted;
  80.     int        user_msg_prior_read;
  81.     int        user_msg_highest_scan;
  82.     long       user_msg_caller_no;
  83.     int        user_msg_hash_code;
  84.     char       user_msg_banned;
  85.     int        user_msg_marked[2];
  86. } USER_MSG_RECORD ;
  87.  
  88. typedef struct _mdirbbs {
  89.     char    mdesc[70];
  90.     char    mpath[50];
  91.     char    mflag[5];
  92.     char    mlevl[2];
  93. } GTMDIR;
  94.  
  95.  
  96.  
  97. struct flag_attrib {
  98.    unsigned int sticky:1;
  99.    unsigned int fidoorg:1;
  100.    unsigned int b1:1;
  101.    unsigned int b2:1;
  102.    unsigned int b3:1;
  103.    unsigned int b4:1;
  104.    unsigned int b5:1;
  105.    unsigned int b6:1;
  106. };
  107.  
  108. typedef struct _msgrec {
  109.     char          msg_deleted;
  110.     int           msg_number;
  111.     char          msg_sender[31];
  112.     char          msg_addressee[31];
  113.     char          msg_topic[31];
  114.     char          msg_date[9];
  115.     int           msg_dest_net;
  116.     char          msg_time[6];
  117.     char          msg_weekday;
  118.  
  119.     struct flag_attrib   msg_flags;      /*   0x01 - STICKY BIT         */
  120.                                          /*   0x02 - Fidonet Processed  */
  121.     int           msg_dest_node;
  122.     char          msg_perm_priv;    /* 0x00 = public non-kp */
  123.     char          msg_received;     /* 0x01 = msg received */
  124.     char          msg_filler;
  125.     int           msg_reply_no[3];
  126.     int           msg_orig_no;
  127. } MSG_RECORD;
  128.  
  129. /* prototypes from gtmsg.c, add on to these as you increase that file */
  130.  
  131. long get_gt_callernum(char *);    /* get caller number for specified user     */
  132.                                   /* -1L indicates an error condition         */
  133.  
  134. int get_gt_lowest(char *);        /* get lowest message number in spec. dir   */
  135.                                   /* -1 indicates an error condition          */
  136.  
  137. int get_gt_highest(char *);       /* get highest message number in spec. dir  */
  138.                                   /* -1 indicates an error condition          */
  139.  
  140. int get_gt_lastread(long,char *); /* get lastread for specified caller number */
  141.                                   /* -1 indicates an error conditions         */
  142.  
  143. int prn_gt_msg_hdr(void *);       /* prints out a gt message header record    */
  144.  
  145.  
  146. int get_gt_message(int, char *, void *, char *);  /* read a GT message */
  147.                              /***********************************************/
  148.                              /* int = message number to get                 */
  149.                              /* 1st char * = message base path              */
  150.                              /* void * = pointer to msg.ctl struct          */
  151.                              /* 2nd char * = message text buffer            */
  152.                              /* return value:                               */
  153.                              /*       0 = success                           */
  154.                              /*      -1 = failure                           */
  155.                              /***********************************************/
  156.  
  157. int append_gt_message(char *, void *, char *);  /* writes a GT message */
  158. /* should return either the message number written, or -1 if failure */
  159.  
  160. int set_gt_lastread(long, char *, int);
  161.                       /* set lastread pointer for specified caller # */
  162.                       /* return -1 if failure */
  163.  
  164. int get_next_nf(char *, int);
  165.                         /*  Get next message number that has fidoorg = 0
  166.                             1) message path
  167.                             2) message number to start with
  168.                         */
  169.  
  170.  
  171. char *get_gt_nmaildir(void);
  172.                         /*   careful with this one it ALLOCATES memory
  173.                              permanently for the char* it returns */
  174.  
  175. /* ──────────────  Dos type file handling functions ────────────────── */
  176.  
  177. int filecopy(char *, char *);
  178.  
  179.  
  180.  
  181.